package com.handinfo.android.core.resource;

public class ResHead
{
	public byte m_type;
	public String m_url;
	public int m_version = 1;
	public static final int BASE_VERSION = 1;

	public ResHead()
	{
	}

	public ResHead(int type, String url, int version)
	{
		m_type = (byte) type;
		m_url = url;
		m_version = version;
	}

	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + m_type;
		result = prime * result + ((m_url == null) ? 0 : m_url.hashCode());
		return result;
	}

	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ResHead other = (ResHead) obj;
		if (m_type != other.m_type)
			return false;
		if (m_url == null) {
			if (other.m_url != null)
				return false;
		}
		else if (!m_url.equals(other.m_url))
			return false;
		return true;
	}
	
	@Override
	public String toString()
	{
		return "ResHead [m_type=" + m_type + ", m_url=" + m_url + "]";
	}

	public void dispose()
	{
		m_url = null;
	}
}
